package com.jxs.tourist.util;
import java.io.Serializable;

/**
 * Response JsonResult for RESTful <br>
 * 封装 返回Json 格式数据
 *
 * @author Wmm
 * @since 2017年12月19日 上午17:00
 **/

public class JsonResult<T> implements Serializable {
    private static final long serialVersionUID = -4699713095477151086L;

    /**
     * 数据
     */
    private T data;
    /**
     * 信息
     */
    private String msg;
    /**
     * 状态码
     */
    private int code;

    public Object getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getmsg() {
        return msg;
    }

    public void setmsg(String msg) {
        this.msg = msg;
    }

    public int getcode() {
        return code;
    }

    public void setcode(int code) {
        this.code = code;
    }

    public JsonResult() {
        super();
    }

    public JsonResult(T data, String msg, int code) {
        this.data = data;
        this.msg = msg;
        this.code = code;
    }

    public JsonResult(T data, String msg) {
        this.data = data;
        this.msg = msg;
        this.code = 0;
    }

    public JsonResult(T data) {
        this.data = data;
        this.code = 1;
    }
}